package com.zzyl.nursing.vo;

import cn.hutool.core.date.LocalDateTimeUtil;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.time.LocalDateTime;
import java.time.LocalTime;
import java.util.ArrayList;
import java.util.List;

@Data
@AllArgsConstructor
@NoArgsConstructor
public class DeviceDateVo {
    private String dateTime;
    private Double dateValue;
    public static List<DeviceDateVo> dayInstance(LocalDateTime startTime){
        List<DeviceDateVo> list = new ArrayList<>();
        for(int i = 0; i < 24; i++){
            LocalDateTime dataTime = startTime.plusHours(i);
            DeviceDateVo deviceDateVo = new DeviceDateVo();
            deviceDateVo.setDateTime(LocalDateTimeUtil.format(dataTime,"HH:00"));
            deviceDateVo.setDateValue(0.0);
            list.add(deviceDateVo);
        }
        return list;
    }
}
